import {reqUserTradeInfo} from '@/api'

const state = {
    userInfo: {},
  
}
const mutations = {
    //拿到用户信息
    RECEIVE_USERINFO(state, userInfo) {
        state.userInfo = userInfo
    }
}
const actions = {
    //得到用户信息
    async getUserTradeInfo({ commit }) {
        const result = await reqUserTradeInfo()
        // console.log('reqUserTradeInfo',result);
        if (result.code === 200) {
            commit('RECEIVE_USERINFO', result.data)
        } else {
            alert('获取用户信息失败')
        }
    }

}
const getters = {}





export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters
}